const TokenKey = "token";
const LocationKey = "locationAuth";
const UidKey = "uid";
const UserInfo = "userInfo";
const Openid = "openid";
//获取token
export function getToken() {
	if(!uni.getStorageSync(TokenKey)){
		return false
	}else{
		return true
	}
}
//获取userinfo
export function getUserInfo() {
	if(!uni.getStorageSync(UserInfo)){
		return false
	}else{
		return true
	}
}
export function hasLogin(){
	if(!uni.getStorageSync(TokenKey)){
		uni.showToast({
			title:'暂未登录',
			icon:'none'
		})
		return false
	}else{
		return true
	}			
}
//保存token
export function setToken(token) {
    return uni.setStorageSync(TokenKey, token);
}
//保存userinfo
export function setUserInfo(userInfo) {
    return uni.setStorageSync(UserInfo, userInfo);
}
//保存openid
export function setOpenid(openid) {
    return uni.setStorageSync(Openid, openid);
}



